use std::io;
fn main() {
    const SCALAR: &str = "标量代表一个单独的值四种基本的标量类型: 整型浮点型布尔型字符类型";
    println!("{}",SCALAR);
    const c: &str = "z";
    println!("{}",c);
    let h = 'h';
    println!("{}",h);
    out_length();
}

fn out_length() {
    let a = [1,2,3,4,5];
    println!("输入下标:");
    let mut index = String:: new();
    io::stdin().read_line(&mut index).expect("读取失败");
    let index: usize = index.trim().parse().expect("不是数字");
    let el = a[index];
    println!("输入的下标是{},对应的值是{}",index,el);
    if  index < 100 {
        out_length()
    }
}